package com.ule.activity.service.impl;

import com.ule.activity.dao.EmpMapper;
import com.ule.activity.model.Emp;
import com.ule.activity.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author wuli
 * @create 2021-10-31 13:42
 */
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    EmpMapper empMapper;

    @Override
    public List<Emp> queryEmp() {
        Emp emp = new Emp();
        emp.setEmpno(new Short("7369"));
        return empMapper.select(emp);
    }

    @Override
    public void insertEmp() {
        Emp emp = new Emp();
        emp.setEmpno(null);
        emp.setComm(null);
        emp.setDeptno(new Short("10"));
        emp.setEname("Tom");
        emp.setHiredate(new Date());
        emp.setJob("CLERK");
        emp.setMgr(new Short("7782"));
        emp.setSal(new BigDecimal("1500.00"));

        empMapper.insert(emp);

    }
}
